const getters = {
  getCartNum(state) {
	  return function (goodsId) {
		  const cartList = state.cart.cartList;
		  let cartNum = 0;
		  for(let goods of cartList) {
		  		  if(goods.id === goodsId) {
		  			  cartNum += goods.num
		  		  }
		  }
		  return cartNum === 0 ? '' : cartNum;
	  }
  },
  token() {
	  return uni.getStorageSync('token') || null;
  },
  recommender() {
	  return uni.getStorageSync('recommender') || null;
  },
  appId: () => "wx0d3d45a088e0a505",
  shop: state => state.shop.shop,
  userId: state => state.user.userId,
}
export default getters